home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / PROHP.ARJ / DSCALEF.PRG < prev    next >
Text File  |  1992-06-23  |  3KB  |  74 lines

  1. /*
  2.   ┌─────────────────────────────────────────────────────────────────────────┐
  3.   │                                                                         │
  4.   │   Program : scalef.prg                                                  │
  5.   │   Purpose : Usage of scalable fonts.                                    ├
  6.   │                                                                         │
  7.   │   Author  : Copyright (C) 1992, I.L.A.,Inc. All Rights reserved.        │
  8.   │                                                                         │
  9.   │   Comments: This source code may be distributed and used freely         │
  10.   │             provided that the copyright notice is not removed.          │
  11.   │                                                                         │
  12.   └─────────────────────────────────────────────────────────────────────────┘
  13. */
  14.  
  15. #include "prohp.ch"
  16. static zpoint:=10, zstyle:=UPRIGHT, zsw:=0, zsym:=SYM_PC_8
  17. static ztypeface:=4101
  18. STATIC aWUniverse[256]
  19.  
  20. proc main()
  21. Local o,st1,st2,T,apt
  22. Local AST,cline, bFont[8],f,i,aWidth,nLeft:=18,aFont
  23. bFont[1]:={|p| HP_scalef(p,UPRIGHT,0,SYM_PC_8,TF_UNIVERSE)}
  24. bFont[2]:={|p| HP_scalef(p,ITALIC,0,SYM_PC_8,TF_UNIVERSE)}
  25. bFont[3]:={|p| HP_scalef(p,UPRIGHT,3,SYM_PC_8,TF_UNIVERSE)}
  26. bFont[4]:={|p| HP_scalef(p,ITALIC,3,SYM_PC_8,TF_UNIVERSE)}
  27. bFont[5]:={|p| HP_scalef(p,UPRIGHT,0,SYM_PC_8,TF_CGTIMES)}
  28. bFont[6]:={|p| HP_scalef(p,ITALIC,0,SYM_PC_8,TF_CGTIMES)}
  29. bFont[7]:={|p| HP_scalef(p,UPRIGHT,3,SYM_PC_8,TF_CGTIMES)}
  30. bFont[8]:={|p| HP_scalef(p,ITALIC,3,SYM_PC_8,TF_CGTIMES)}
  31. set2print("dscalef.hpc")
  32. hp_init()
  33. HP_send(.f.)
  34. cline:=HP_setpos(-0.1,,.t.)+HP_rline(0.15,0.005)+HP_setpos(0.1,,.t.)
  35.  
  36. HP_send(.t.)
  37. ST1:="ProHP"
  38. st2:="Laser Printer library for Clipper"
  39.  
  40. // draw gray area covering the full page
  41. // this trick will show you the printing area on the page
  42. HP_hline(0,0,12,10,GFILLGRAY,10)
  43. HP_box(0,0,10,HP_data(D_RMI)-HP_data(D_LMI)-HP_data(D_LINEWIDTH))
  44. HP_lpi(3.6) // set lpi but it will not work later because
  45.             // hpscalef() sets LPI according to the point selected
  46.  
  47. // prepare center column
  48. nLeft := (HP_data(D_RMI)-HP_data(D_LMI)) /2
  49. aPt:={5,10,15,20,24,28}
  50. HP_setpos(0,0)
  51. for i:=1 to len(aPt)
  52.         eval(bFont[i],aPt[i]*4)  // make font
  53.         HP_rcpos(1,,.t.)        // down one line
  54.         HP_center(,nLeft,st1)   // center text on page
  55.         eval(bFont[i],aPt[i])   // same font different size
  56.         HP_rcpos(1,,.t.)        // down one line
  57.         HP_center(,nLeft,st2)   // center next text line
  58. next
  59.  
  60. eval(bFont[4],aPt[4]) // make scalable font
  61. HP_rcpos(2,,.t.) // two lines down
  62.  
  63. // start at the current row , find the current margin - 1 space
  64. // and print the array right justify
  65. HP_aatsay(,HP_data(D_RMI)-HP_data(D_LMI)-1/HP_data(D_CPI),;
  66.         {st1,st2},,"R")
  67.  
  68. //HP_reset()  // reset will erase the scalable fonts created above.
  69. HP_feed()       // just print and feed the page out.
  70. set2screen()
  71. return
  72.  
  73.  
  74.